<!DOCTYPE html>
<html>
<head>
    
    <include file="Common/head"/>
    
    <link href="__CSS__/plugins/iCheck/custom.css" rel="stylesheet">

</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    
    <!-- Panel Other -->
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5>菜单编辑</h5>
        </div>
        <div class="ibox-content">
            <div class="row row-lg">
                <div class="col-sm-12">
                    
                    <include file="Common/alert"/>
                    
                    <div class="clearfix" style="width:100%;">
                        <div class="bars pull-left">
                            <div class="btn-group hidden-xs" id="exampleTableEventsToolbar" role="group">
                                <button type="button" class="btn btn-outline btn-default" href="{:U('Category/index')}" style="padding-bottom: 8px;padding-top: 8px;">
                                    <i class="glyphicon glyphicon-chevron-left" aria-hidden="true"></i>
                                </button>
                                <button type="button" class="btn btn-outline btn-default" href="{:U('Category/edit',['pid'=>$info['pid']?:I('get.pid',0)])}" style="padding-bottom: 8px;padding-top: 8px;">
                                    <i class="glyphicon glyphicon-plus" aria-hidden="true"></i>
                                </button>
                                <button class="btn btn-default btn-outline" type="button" name="refresh" title="刷新" href="__SELF__" style="padding-bottom: 8px;padding-top: 8px;">
                                    <i class="glyphicon glyphicon-repeat"></i>
                                </button>
                                <button type="button" class="btn btn-outline btn-default confirm" href="{:U('Category/delete',['id'=>$info['id']])}" style="padding-bottom: 8px;padding-top: 8px;">
                                    <i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
                                </button>
                            </div>
                        </div>
                    </div>
    
                    <form method="post" action="__SELF__" class="form-horizontal">
    
    
                        <div class="hr-line-dashed"></div>
    
                        <div class="form-group">
                            <label class="col-sm-2 control-label">上级分类</label>
                            <div class="col-sm-10">
                                <input disabled="disabled" type="text" name="pid" class="form-control" value="{$info.parent.title|default='顶级菜单'}">
                                <input type="hidden" name="pid" class="form-control" value="{$info.pid|default='0'}">
                            </div>
                        </div>
        
                        <div class="hr-line-dashed"></div>
        
                        <div class="form-group">
                            <label class="col-sm-2 control-label">分类标题</label>
                            <div class="col-sm-10">
                                <input name="title" type="text" class="form-control" value="{$info.title|default=''}">
                                <span class="help-block m-b-none">不能为空</span>
                            </div>
                        </div>
    
                        <div class="hr-line-dashed"></div>
    
                        <div class="form-group">
                            <label class="col-sm-2 control-label">分类标识</label>
                            <div class="col-sm-10">
                                <input name="name" type="text" class="form-control" value="{$info.name|default=''}">
                                <span class="help-block m-b-none">不能为空，英文字母，用于构建URL</span>
                            </div>
                        </div>
                        
    
    
                        <div class="hr-line-dashed"></div>
    
                        <div class="form-group">
                            <label class="col-sm-2 control-label">绑定模型</label>
                            <div class="col-sm-10">
                                <volist name="models" id="model">
                                    <div class="radio i-checks">
                                        <label>
                                            <input type="radio" value="{$model.id}" name="model_id" <eq name="info.model_id" value="$model['id']">checked="checked"</eq>> <i></i> {$model.title}
                                        </label>
                                    </div>
                                </volist>
                                <div class="radio i-checks">
                                    <label>
                                        <input type="radio" value="0" name="model_id" <eq name="info.model_id" value="0">checked="checked"</eq>> <i></i> 无文档模型
                                    </label>
                                </div>
                            </div>
                        </div>
    
    
                        <div class="hr-line-dashed"></div>
    
                        <div class="form-group">
                            <label class="col-sm-2 control-label">详情模板</label>
                            <div class="col-sm-10">
                                <input name="template_detail" type="text" class="form-control" value="{$info.template_detail|default=''}">
                                <span class="help-block m-b-none">为空则使用默认模板</span>
                            </div>
                        </div>
    
    
                        <div class="hr-line-dashed"></div>
    
                        <div class="form-group">
                            <label class="col-sm-2 control-label">列表模板</label>
                            <div class="col-sm-10">
                                <input name="template_index" type="text" class="form-control" value="{$info.template_index|default=''}">
                                <span class="help-block m-b-none">为空则使用默认模板</span>
                            </div>
                        </div>
    
                        <div class="hr-line-dashed"></div>
    
                        <div class="form-group">
                            <label class="col-sm-2 control-label">父级分类</label>
                            <div class="col-sm-10">
                                <div class="radio i-checks">
                                    <label>
                                        <input type="radio" value="0" name="is_parent" <eq name="info.is_parent" value="0">checked="checked"</eq>> <i></i> 否
                                    </label>
                                </div>
                                <div class="radio i-checks">
                                    <label>
                                        <input type="radio" value="1" name="is_parent" <eq name="info.is_parent" value="1">checked="checked"</eq>> <i></i> 是</label>
                                </div>
                                <span class="help-block m-b-none">如果是父级分类，则必须有子级分类，列表中有导航显示</span>
                            </div>
                        </div>
    
                        <div class="hr-line-dashed"></div>
    
                        <div class="form-group">
                            <label class="col-sm-2 control-label">子级分类</label>
                            <div class="col-sm-10">
                                <div class="radio i-checks">
                                    <label>
                                        <input type="radio" value="0" name="is_child" <eq name="info.is_child" value="0">checked="checked"</eq>> <i></i> 否
                                    </label>
                                </div>
                                <div class="radio i-checks">
                                    <label>
                                        <input type="radio" value="1" name="is_child" <eq name="info.is_child" value="1">checked="checked"</eq>> <i></i> 是</label>
                                </div>
                                <span class="help-block m-b-none">如果是子级分类，则必须有父级分类</span>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
    
                        <div class="form-group">
                            <label class="col-sm-2 control-label">是否允许发布内容</label>
                            <div class="col-sm-10">
                                <div class="radio i-checks">
                                    <label>
                                        <input type="radio" value="0" name="allow_publish" <eq name="info.allow_publish" value="0">checked="checked"</eq>> <i></i> 否
                                    </label>
                                </div>
                                <div class="radio i-checks">
                                    <label>
                                        <input type="radio" value="1" name="allow_publish" <eq name="info.allow_publish" value="1">checked="checked"</eq>> <i></i> 是</label>
                                </div>
                            </div>
                        </div>
    
                        <div class="hr-line-dashed"></div>
    
                        <div class="form-group">
                            <label class="col-sm-2 control-label">是否禁用</label>
                            <div class="col-sm-10">
                                <div class="radio i-checks">
                                    <label>
                                        <input type="radio" value="0" name="status" <eq name="info.status" value="0">checked="checked"</eq>> <i></i> 否
                                    </label>
                                </div>
                                <div class="radio i-checks">
                                    <label>
                                        <input type="radio" value="1" name="status" <eq name="info.status" value="1">checked="checked"</eq>> <i></i> 是</label>
                                </div>
                            </div>
                        </div>
    
                        <div class="hr-line-dashed"></div>
    
                        <div class="form-group">
                            <label class="col-sm-2 control-label">说明</label>
                            <div class="col-sm-10">
                                <textarea name="tip" class="form-control" rows="4">{$info.tip|default=''}</textarea>
                                <span class="help-block m-b-none">分类详细说明</span>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
        
                        <input type="hidden" name="id" value="{$info.id|default=''}"/>
        
                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-2">
                                <button class="btn btn-primary" type="submit">保存内容</button>
                                <button class="btn btn-white" type="submit" onclick="window.history.go(-1);">取消</button>
                            </div>
                        </div>
                    </form>
                </div>
                
            </div>
        </div>
    </div>
    <!-- End Panel Other -->
</div>
<include file="Common/footer"/>
<script src="__JS__/content.min.js?v=1.0.0"></script>
<script src="__JS__/plugins/iCheck/icheck.min.js"></script>
<script src="__JS__/plugins/summernote/summernote.min.js"></script>
<script src="__JS__/plugins/summernote/summernote-zh-CN.js"></script>

<script>
    $(document).ready(function(){$(".i-checks").iCheck({checkboxClass:"icheckbox_square-green",radioClass:"iradio_square-green",})});
    $(document).ready(function(){$(".summernote").summernote({lang:"zh-CN"})});var edit=function(){$("#eg").addClass("no-padding");$(".click2edit").summernote({lang:"zh-CN",focus:true})};var save=function(){$("#eg").removeClass("no-padding");var aHTML=$(".click2edit").code();$(".click2edit").destroy()};
</script>
</body>
</html>
